define(["jquery","bbcare",
	 "fu/app/comm/attention","fu/app/question/question.ui","fu/app/question/question.event",
	 'bch/app/vaccine/vaccineInoculationHistory.ui',
     'bch/app/vaccine/vaccineInoculationHistory.servers',
     'bch/app/vaccine/vaccineInoculationAdd.servers'],function($,$bb,$attention,$questionUi,$questionEvent,$ui,$servers,$addservers){
	var vaccineInoculationHistory = {};

    /**
     * 点击xx月龄接种记录，
     */
    var onMonthAgeSelect = function(){
        $(this).addClass("active").siblings().removeClass("active");
        var type = $(this).attr("data-type");
        var questiones = $addservers.getQuestiones(type);
        var values = $servers.getValues(type);
        $questionUi.init({
            "id":"inoculationHistoryForm",
            "status":"readonly",
            "list":questiones,
            "values":values,
        });
        $questionEvent.init();
        $attention.init();
    }

	vaccineInoculationHistory.init = function(){
        var params = $bb.getPageParams();
        $ui.info({
            "id":"inoculationHistoryInfo",
            "data":params.info
        });
        $ui.tab({
            "id":"historyList"
        });
        $("#historyList li").unbind("click");
        $("#historyList li").click(onMonthAgeSelect);
        $("#historyList li").eq(0).click();
        $("#lookAllRecord").unbind("click");
        $("#lookAllRecord").click(function(){
            $bb.openPage("bch_vaccineInoculationSchedule",params);
        });
	}

	return vaccineInoculationHistory;
});